package com.k.suess;

import org.springframework.security.web.session.InvalidSessionStrategy;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @program: SpringSecote01
 * @ClassName SessionScessConfig
 * @description:
 * @author: xiaoJie
 * @create: 2024-09-12 13:34
 * @Version 1.0
 */
public class SessionScessConfig implements InvalidSessionStrategy {
    @Override
    public void onInvalidSessionDetected(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws IOException, ServletException {
        httpServletRequest.getSession();
        httpServletResponse.sendRedirect("/login");
    }
}
